<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .bigBox{
            width: 400px;
        }
        .box{
            display: flex;
        }
        .box .item{
            flex: 1;
            text-align: center;
        }
        .item1{
            background-color: red;
        }
        .item2{
            background-color: white;
        }
        .boxBottom{
            height: 100px;
            display: none;
            background-color: white;
        }
        .boxBottom1{
            display: block;
            background-color:greenyellow;
        }
    </style>
</head>
<body>
   <div class="bigBox">
        <div class="box">
            <div class="item item1">页面一</div>
            <div class="item">页面二</div>
            <div class="item">页面三</div>
        </div>
       <div class="center">
            <div class="boxBottom boxBottom1">123</div>
            <div class="boxBottom" style="background-color: red;">456</div>
            <div class="boxBottom" style="background-color: blue;">789</div>
       </div>
   </div>
    <script>
        let item = document.querySelectorAll('.item');
        let boxBottom = document.querySelectorAll('.boxBottom');
        for(let i=0;i<item.length;i++){
            item[i].onclick=function(){
                let child = this.parentElement.children;
                for(let i=0;i<child.length;i++){
                    boxBottom[i].className = "boxBottom"
                    child[i].className = "item item2";
                }
                this.className = 'item item1';
                boxBottom[i].className = "boxBottom boxBottom1"
            }
        }
    </script>
</body>
</html>